package controller;

import com.alibaba.fastjson.JSONArray;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import pojo.Comment_user;
import service.Comment_userService;

import java.util.List;

@Controller
@RequestMapping("/comment_userController")
public class Comment_userController {
    @Autowired
    private Comment_userService comment_userServiceImpl;

    public Comment_userService getComment_userServiceImpl() {
        return comment_userServiceImpl;
    }

    public void setComment_userServiceImpl(Comment_userService comment_userServiceImpl) {
        this.comment_userServiceImpl = comment_userServiceImpl;
    }
    @ResponseBody
    @RequestMapping(value = "/seelcts.do")
    private String seelcts(Comment_user comment_user){
        System.out.println("进入遍历后台方法");
        List<Comment_user> select = comment_userServiceImpl.selects(comment_user);
        for (Comment_user commentUser : select) {
            System.out.println(commentUser.toString());
        }
        return JSONArray.toJSONString(select);
    }
}
